package com.un10.qianduan.contorller;

import java.util.List;


import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.un10.entity.Proclass;
import com.un10.entity.Product;
import com.un10.entity.Rotationchart;
import com.un10.service.ProclassService;
import com.un10.service.ProductService;
import com.un10.service.RotaService;
@Controller
public class indexWebController {
	@Autowired
	 RotaService rotaService;
	 @Autowired
	ProclassService proclassService;
	 @Autowired																																	
	 ProductService   productService;
	  @RequestMapping("/A/proCate")	
	  public String proCate(Model model, HttpSession session) {
		  //轮播图
	    List<Rotationchart> Rot = rotaService.findAllRot(0, 9999, null);
	    model.addAttribute("Rot", Rot);	
	    // 重定向到主页面的跳转方法
	    System.out.println(Rot);
	    //商品分类
	    List<Proclass> proclass = proclassService.findAllProclass(0, 9999, null);
	    model.addAttribute("proclass", proclass);	
	    // 重定向到主页面的跳转方法
//	    System.out.println(proclass);
	    
	    
	    List<Product> product = productService.findAllProduct(0, 9999, null,null);
	    model.addAttribute("product", product);	
	    // 重定向到主页面的跳转方法
//	    System.out.println(product);	      
	    
	    return "A/index";
	  }


	}

	
	

